<%@include file="/common/header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<%=rootPath %>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<%=rootPath %>/js/jquery.form.js"></script>
<sx:head/>
<%--
<script type="text/javascript" src="<%=rootPath %>/js/json.js"></script> 
 --%> 
<head>
<script type="text/javascript"> 
	function actionSubmit(btn){
 
		 var options = { 
		      //  target:        '#clickbtn',   // target element(s) to be updated with server response 
		      //  beforeSubmit:  showRequest,  // pre-submit callback 
		        success:       update_page,  // post-submit callback 
		        // other available options: 
		        url:       "jsonAction.html",         // override for form's 'action' attribute 
		        type:       "post",        // 'get' or 'post', override for form's 'method' attribute 
		        dataType:  "json"        // 'xml', 'script', or 'json' (expected server response type) 
		        //clearForm: true        // clear all form fields after successful submit 
		        //resetForm: true        // reset the form after successful submit 
		 
		        // $.ajax options can be used here too, for example: 
		        //timeout:   3000  
		    }  
		 
		    // bind form using 'ajaxForm' 
		    $('#myform').ajaxForm(options,btn); 
	 
	} 
 
	function update_page(result) {
			alert(result.name);
			for(var i=0;i<result.usrList.length;i++){
				//	alert(result.usrList[i].name);
			}
	}
 
 </script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="jsonAction2.html" method="post" id="myform">
	Name:<input type="text" name="name" /><br/>
	Age:<input type="text" name="age"/><br/>
	<input id="clickbtn" type="button"  name="mon1" value="dddd" onclick="actionSubmit(this)"/>
	<input type="button" name="mon"  value="dddff"/>
</form>
</body>
</html>